from django.urls import path

from book import views

app_name = 'book'
urlpatterns=[

    # http://127.0.0.1:8000/book?id=3
    path('', views.book_detail_query_string,name='book_detail_query_string'),
    # #在book_id前指定参数类型有两点好处:
    # #1、以后在浏览器中，如果book_id输入的是一个非整形，那么会出现404错误:/book/abc
    # #2.在视图函数中，得到的book_id就是一个整形
    # 参数类型 int
    path('<int:book_id>', views.book_detail_path,name='book_detail_path'),
    # 参数类型 str
    path('str/<str:book_id>', views.book_str,name='book_str'),
    # 参数类型 slug
    path('slug/<slug:book_id>', views.book_slug,name='book_slug'),
    # 参数类型 uuid
    path('uuid/<uuid:book_id>', views.book_uuid,name='book_uuid'),
    # 参数类型 pa
    path('path/<path:book_id>', views.book_path,name='book_path'),

    path('<int:book_id>',views.book_detail,name='book_detail'),

    path('index',views.index,name='index'),
    path('add',views.add_book,name='add_book'),

    path('query',views.query_book,name='query_book'),

    path('order',views.order_book,name='order_book'),
    path('update',views.update_book,name='update_book'),
    path('delete',views.delete_book,name='delete_book'),

    path('tag',views.book_tag,name='book_tag'),

]